
/**
	processAndTask
**/
function startProcess(uuid,data){
		$("body").append("<div  style='top:0px;left:0px;position:absolute;width:100%;height:100%;filter:alpha(Opacity=80);-moz-opacity:0.5;opacity: 0.5;z-index:100; background-color:#ffffff;' ><img src='/suite/app/img/loading.gif' style='position:absolute;left:48%;top:10%;width:40px;height:40px;' /></div>")
		data["uuid"]=uuid;
		$.ajax({
            url: "/suite/plugins/servlet/SetProcessActiveVariable",
			   type:"post",
			   data:data,
			   async:false,
		           success: function (rs) {
		            	if(rs!=null&&rs!=""){
								setTimeout(function(){
									$.ajax({
										url: "/suite/plugins/servlet/getProcessDetail",
										   type:"post",
										   data:{id:rs},
										   async:false,
											   success: function (processDetail) {
													window.parent.postMessage('{"type":"submit","processDetail":'+JSON.stringify(processDetail.result)+'}','*');
												},
												error: function () {
													alert("流程提交失败,请联系管理员！")
											   }
									});
								},1000)
									
								
						}
		            },
		            error: function () {
						alert("流程提交失败,请联系管理员！")
		           }
		});

}

function submit(id,data){
	$("body").append("<div  style='top:0px;left:0px;position:absolute;width:100%;height:100%;filter:alpha(Opacity=80);-moz-opacity:0.5;opacity: 0.5;z-index:100; background-color:#ffffff;' ><img src='/suite/app/img/loading.gif' style='position:absolute;left:48%;top:10%;width:40px;height:40px;' /></div>")
		data["activityId"]=id;
		data["isSubmit"]=true;
		
		$.ajax({
            url: "/suite/plugins/servlet/setTaskActiveVariable",
			   type:"post",
			   data:data,
			   async:false,
		           success: function (text) {
		            	if(text=="0"){
							console.log("error")
						}else if(text=="1"){
							setTimeout(function(){
								window.parent.postMessage('{"type":"submit"}','*');
							}, 1000);
						}else{
							setTimeout(
								function(){
									window.top.location="/suite/app/index.html#/app/taskdetail/"+text;
									}
							, 1000);
						}
		            },
		            error: function () {
						console.log("error")
		           }
		});

}
function saveData(id,data){
		data["activityId"]=id;
		$.ajax({
            url: "/suite/plugins/servlet/setTaskActiveVariable",
			   type:"post",
			   data:data,
			   async:false,
		           success: function (text) {
		            	if(text=="0"){
							console.log("error")
						}else if(text=="1"){
							window.parent.postMessage('{"type":"save"}','*');
						}
		            },
		            error: function () {
						console.log("error")
		           }
		});
}






